﻿@page "/admin/oplog"
@attribute [Authorize]
@attribute [RolePermission]
@inherits ComponentDefault
@using ThingsGateway.Admin.Application
@namespace ThingsGateway.Admin.Razor

<Chart @ref=LineChart OnInitAsync="OnInit" Height="var(--line-chart-height)" Width="100%" OnAfterInitAsync="()=>{chartInit=true;return Task.CompletedTask;}" />
    <div class="line-chart-table-height">
    <AdminTable TItem="SysOperateLog" AutoGenerateColumns="true" ShowDefaultButtons=false  ShowSearchButton=false
                AllowResizing="true" IsFixedHeader=true IsMultipleSelect=false
                ShowExtendEditButton=false ShowExtendDeleteButton=false ShowExtendButtons=false
                ShowExportButton="true"   
                OnQueryAsync="OnQueryAsync" IsPagination=true CustomerSearchModel="@CustomerSearchModel">
        <CustomerSearchTemplate>
            @if (context is OperateLogPageInput model)
            {
                @Render(model)
            }
        </CustomerSearchTemplate>
        <ExportButtonDropdownTemplate Context="ExportContext">
            <div class="dropdown-item" @onclick="() => ExcelExportAsync(ExportContext)">
                <i class="fas fa-file-export"></i>
                <span>@RazorLocalizer["TablesExportButtonExcelText"]</span>
            </div>
        </ExportButtonDropdownTemplate>
    </AdminTable>
</div>
@code {
    RenderFragment Render(OperateLogPageInput model) =>
    @<div class="row form-inline g-2">
        <div class="col-12 ">
            <BootstrapInput @bind-Value="model.Account" ShowLabel="true" />
        </div>
        <div class="col-12 ">
            <DateTimeRange @bind-Value="model.SearchDate" ShowLabel="true" />
        </div>
        <div class="col-12 ">
            <Select @bind-Value="model.Category" ShowLabel="true" PlaceHolder="All" IsPopover />
        </div>
    </div>;

}
